package cn.anecansaitin.firecrafting.common.item;

import cn.anecansaitin.firecrafting.ModConstant;
import cn.anecansaitin.firecrafting.common.block.ModBlocks;
import cn.anecansaitin.firecrafting.common.table.ModCreateTable;
import net.minecraft.network.chat.TranslatableComponent;
import net.minecraft.world.item.BlockItem;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Rarity;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

import java.util.List;

public class ModItems {
    //创建物品注册器
    public static final DeferredRegister<Item> ITEM = DeferredRegister.create(ForgeRegistries.ITEMS, ModConstant.MOD_ID);
    //注册物品
    public static final RegistryObject<Item> ENDER_LIGHTER = ITEM.register("ender_lighter",() -> new Lighter(ModBlocks.ENDER_FIRE.get(), Rarity.UNCOMMON, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.OBSIDIAN.getName()))));
    public static final RegistryObject<Item> RAINBOW_LIGHTER = ITEM.register("rainbow_lighter",() -> new Lighter(ModBlocks.RAINBOW_FIRE.get(), Rarity.EPIC, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.AMETHYST_BLOCK.getName()))));
    public static final RegistryObject<Item> HELL_LIGHTER = ITEM.register("hell_lighter",() -> new Lighter(ModBlocks.HELL_FIRE.get(), Rarity.RARE, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.MAGMA_BLOCK.getName()))));
    public static final RegistryObject<Item> HEAVEN_LIGHTER = ITEM.register("heaven_lighter",() -> new Lighter(ModBlocks.HEAVEN_FIRE.get(), Rarity.RARE, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.SOUL_SAND.getName()))));
    public static final RegistryObject<Item> THREE_MEIS_TRUE_FIRE_LIGHTER = ITEM.register("three_meis_true_fire_lighter",() -> new Lighter(ModBlocks.THREE_MEIS_TRUE_FIRE.get(), Rarity.EPIC, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.BEACON.getName()))));
    public static final RegistryObject<Item> MAGIC_LIGHTER = ITEM.register("magic_lighter",() -> new Lighter(ModBlocks.MAGIC_FIRE.get(), Rarity.UNCOMMON, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.GOLD_BLOCK.getName()))));
    public static final RegistryObject<Item> DRAGON_BREATH_LIGHTER = ITEM.register("dragon_breath_lighter",() -> new Lighter(ModBlocks.DRAGON_BREATH_FIRE.get(), Rarity.EPIC, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.BEACON.getName()))));
    public static final RegistryObject<Item> COMPANION_LIGHTER = ITEM.register("companion_lighter",() -> new Lighter(ModBlocks.COMPANION_FIRE.get(), Rarity.UNCOMMON, List.of(new TranslatableComponent("tooltip.fire_crafting.oxidizer").append(Blocks.SLIME_BLOCK.getName()))));
    //Bloc__________
    public static final RegistryObject<Item> FIRE_INTERFACE = ITEM.register("fire_interface", () -> new BlockItem(ModBlocks.FIRE_INTERFACE.get(), new Item.Properties().fireResistant().tab(ModCreateTable.TAB)));
    //TeaCon打开物品
    public static final RegistryObject<Item> COLOURFUL_FIRE = ITEM.register("colourful_fire", () -> new Item(new Item.Properties().tab(ModCreateTable.TAB)));

    //注册器的调用
    public static void registry(IEventBus bus) {
        ITEM.register(bus);
    }
}
